package wang.lcs.pay.util;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

public class WebUtil {

    public static Map<String, String> request2map(HttpServletRequest request) {
        Enumeration<String> names = request.getParameterNames();
        Map<String, String> map = new HashMap<>();
        while (names.hasMoreElements()) {
            String key = names.nextElement();
            String val = request.getParameter(key);
            map.put(key, val);
        }
        return map;
    }

}
